/************************************************************************

								Heroes IV
					  Copyright 2002, The 3DO Company

	------------------------------------------------------------------
  						 combat_area_shader.h

	$Header:  $

	$NoKeywords: $

 ************************************************************************/

#if !defined( COMBAT_AREA_SHADER_H_INCLUDED )
#define COMBAT_AREA_SHADER_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "abstract_bitmap_typedef.h"
#include "abstract_combat_object.h"
#include "isometric_map.h"
#include "owned_ptr.h"
#include "screen_point.h"

class t_battlefield;
class t_battlefield_terrain_map;
class t_paletted_16_layer;
class t_combat_area_shader_data;

// -----------------------------------------------------------------------
// The combat area shader can shading an area in the combat window. This 
// shading can indicate the area a creature can move to, the LOS for a 
// creature, etc. Each tile on the battlefield can be shaded a different 
// color, or can be set to transparent.
// -----------------------------------------------------------------------
class t_combat_area_shader : public t_abstract_combat_object
{
	public:
		t_combat_area_shader( t_battlefield & battlefield );
		~t_combat_area_shader();

		virtual bool					blocks_movement() const;
		virtual void					draw_shadow_to(
											t_uint32				current_time,
											t_screen_rect const &	source_rect,
											t_abstract_bitmap16 &	dest,
											t_screen_point const &	dest_point ) const;
		virtual void					draw_shadow_to(
											t_uint32				current_time,
											t_abstract_bitmap16 &	dest,
											t_screen_point const &	dest_point ) const;
		virtual void					draw_to(
											t_uint32				current_time,
											t_screen_rect const &	source_rect,
											t_abstract_bitmap16 &	dest,
											t_screen_point const &	dest_point ) const;
		virtual void					draw_to(
											t_uint32				current_time,
											t_abstract_bitmap16 &	dest,
											t_screen_point const &	dest_point ) const;
		virtual int						get_depth() const;
		virtual int						get_footprint_size() const;
		virtual int						get_height() const;
		virtual t_combat_object_type	get_object_type() const;
		virtual t_screen_rect			get_rect() const;
		virtual t_screen_rect			get_rect( t_uint32 current_time ) const;
		virtual t_screen_rect			get_shadow_rect() const;
		virtual t_screen_rect			get_shadow_rect( t_uint32 current_time ) const;
		virtual bool					hit_test( t_uint32				current_time,
												  t_screen_point const &	point ) const;
		virtual bool					is_animated() const;
		virtual bool					is_underlay() const;
		virtual bool					needs_redrawing( t_uint32	last_update_time,
														 t_uint32	current_time ) const;
		virtual void					on_placed();
		virtual void					on_removed();
		virtual void					place_during_read( t_battlefield& battlefield );
		virtual bool					read( t_combat_reader& reader );
		void							reset( t_battlefield const & battlefield ); // Set to no shading
		void							set_shading ( t_combat_area_shader_data const & data, 
													  t_battlefield const & battlefield );
		virtual bool					write( t_combat_writer& writer ) const;

	private:

		t_owned_ptr< t_paletted_16_layer >			m_bitmap; // The actual image to draw, all ready for a bitblit. NULL if nothing to draw
		t_screen_point								m_bitmap_offset;
};

#endif // COMBAT_AREA_SHADER_H_INCLUDED